<?php
/**
 * Created by PhpStorm.
 * User: 共赢岛
 * Date: 2023/12/2
 * Time: 16:36
 */

namespace App\Http\Resources;

use App\Admin\Services\CarService;
use App\Services\LifeCycle\OrderService;
use Illuminate\Http\Resources\Json\JsonResource;

class PackageUsedLogDetailResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'package_title' => $this->package_title,
            'attr_title' => $this->attr_title,
            'store_title' => $this->store->title,
            'used_at' => $this->used_at,
            'status' => $this->status,
            'operator_name' => $this->operator->name,
            'operator_pics' => json_decode($this->operator_pics, true),
            'operator_at' => $this->operator_at,
            'car_number' => $this->car_number,
            'remarks' => $this->remarks ?? '',
            'created_at' => $this->created_at ? $this->created_at->format('Y-m-d H:i:s') : '',
        ];
    }
}